﻿using System;

namespace Domain.Setup.Entities
{
    /// <summary>
    /// Represents a Skill that a staff member may have. Also associated with zero or more Tasks
    /// </summary>
    public sealed class Skill : ICloneable
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Skill"/> class.
        /// </summary>
        public Skill()
        {
            IsActive = true;
        }

        #region Public Properties
        /// <summary>
        /// Gets the Skill id.
        /// </summary>
        public int Id { get; private set; }

        /// <summary>
        /// Gets or sets the Skill name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the Skill description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        public string Description { get; set; }

        /// <summary>
        /// Gets a value indicating whether this instance is active and available for future selection.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance is active; otherwise, <c>false</c>.
        /// </value>
        public bool IsActive { get; private set; } 
        #endregion

        /// <summary>
        /// Sets the Skill as inactive.
        /// </summary>
        public void SetInactive()
        {
            this.IsActive = false;
        }

        public object Clone()
        {
            return new Skill
            {
                Id = this.Id,
                Name = this.Name,
                Description = this.Description,
                IsActive = this.IsActive
            };
        }
    }
}
